﻿#ifndef __LOGGER_DEFINE_H__
#define __LOGGER_DEFINE_H__

//! 消息类型
enum LOG_EVENT
{
  //! 消息
  LOG_INFO	= 1,
  //! 警告
  LOG_WARNING = 2,
  //! 错误
  LOG_ERROR2	= 4,
  //! 调试
  LOG_DEBUG	= 8
};


#define LOG_ERROR LOG_ERROR2


#define logConfigs LOG_INFO | LOG_WARNING | LOG_ERROR

#define LOG_NOTE LOG_INFO
#ifdef DEBUG
  #define LOG_ANOLE   LOG_WARNING
#else
  #define LOG_ANOLE   LOG_DEBUG
#endif

enum LOG_OUTPUT
{
  LOG_OUTPUT_FILE	= 1, /*!< Output to file */
  LOG_OUTPUT_CONSOLE= 2, /*!< Output to console */
  LOG_OUTPUT_DEBUGVIEW	= 4 /*!< Output to dbgview */
};

typedef unsigned long LOG_FLAG ;

#ifndef _vscprintf
	#define _vscprintf(a,b) 10240
#endif //_vscprintf

#ifdef WIN32
#define LOG_CRLF "\r\n"
#else
#define LOG_CRLF "\n"
#endif

const static char g_strInfo[]	= "- Info  -";
const static char g_strWarning[]= "+Warning+";
const static char g_strError[]	= "* Error *";
const static char g_strDebug[]	= "= Debug =";
const static char g_strUnknow[]	= "?unknown?";

static const char*  string_event(int evt)
{
  const char* p = g_strUnknow;
  switch(evt)
  {
  case 1: 
    p = g_strInfo; 
    break;
  
  case 2: 
    p = g_strWarning; 
    break;
 
  case 4: 
    p = g_strError; 
    break;
 
  case 8: 
    p = g_strDebug; 
    break;
 
  default:
    break; 
  }

  return p;
}

#endif //__LOGGER_DEFINE_H__

